package test.lu.materidesign;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.View;

/**
 * Created by Administrator on 2016/10/28 0028.
 */
public class VV extends View {
    private Context mContext;

    public VV(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context);
    }

    public VV(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public VV(Context context) {
        this(context, null);
    }

    private void init(Context context) {
        mContext = context;

    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        Path path = new Path();
        path.moveTo(100, 100);
        path.lineTo(100, 1800);
        path.quadTo(300, 1000, 600, 1800);
        path.cubicTo(900, 1400, 100, 1300, 800, 800);
        Paint p = new Paint();
        p.setStyle(Paint.Style.STROKE);
        p.setColor(Color.BLUE);
        canvas.drawPath(path, p);
    }
}
